package com.jinhongone.pattern.creater.factory.abstractFactory;

public class Test {

    public static void main(String[] args) {

        //找到具体的工厂就可以获得同产品族的全部类
//        Factory factory = new AmericanFactory();
        Factory factory = new ItalyFactory();
        CoffeeStore coffeeStore = new CoffeeStore();
        coffeeStore.setCoffeeFactory(factory);
        Coffee coffee = coffeeStore.orderCoffee();
        System.out.println(coffee.getName());
        Dessert dessert = coffeeStore.orderDessert();
        System.out.println(dessert.getName());

    }
}
